let parse = require("@babel/parser").parse
let generate = require("@babel/generator").default
let traverse = require("@babel/traverse").default
const types = require("@babel/types");

let fs = require("fs")

let js_code = fs.readFileSync("input.js", "utf-8")

let init_ast = parse(js_code)
let ast = parse(js_code)
traverse(init_ast, {
    Program: function (path) {
        path.stop()
        path.get("body")[3].remove()
    }
})


eval(generate(init_ast, {minified: true}).code)
let decode_code = generate(ast, {minified: false}).code
fs.writeFileSync("output.js", decode_code)